Skip to content

Resize - #2

Closed
Ayush-Vish wants to merge 4 commits into
mainfrom
resize
Closed

Ayush-Vish wants to merge 4 commits into
mainfrom
resize

Conversation

@Ayush-Vish

Copy link
Copy Markdown
Owner

No description provided.

@vercel

vercel Bot commented Oct 9, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
shellsyncc Error Error Oct 14, 2025 3:29pm

@netlify

netlify Bot commented Oct 9, 2025 •

Copy link
Copy Markdown

❌ Deploy Preview for shellsync failed.

Name Link
🔨 Latest commit 198e99c
🔍 Latest deploy log https://app.netlify.com/projects/shellsync/deploys/68ee6c150fb3bc00087457c9

@Ayush-Vish
Ayush-Vish requested a review from Copilot October 9, 2025 15:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements terminal resizing functionality for ShellSync, allowing users to dynamically resize terminals in real-time across all connected clients. The implementation adds comprehensive support for terminal resizing through UI controls, WebSocket messaging, and proper PTY management.

  • Added terminal resize controls (minimize, maximize, and incremental resize buttons) to the frontend
  • Implemented WebSocket messaging for broadcasting resize events between clients
  • Enhanced the gRPC protocol and agent to handle PTY resize operations

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
nano.18028.save Temporary save file with test content
frontend/src/lib/types.ts Added width/height properties to canvas items and socket messages
frontend/src/hooks/useSocket.ts Added resize event handling and removed chunkNum parameter
frontend/src/components/terminal/Terminal.tsx Enhanced terminal component with fit functionality and dimension getters
frontend/src/components/terminal/DraggableTerminal.tsx Implemented comprehensive resize UI controls and dimension management
frontend/src/app/ws/[slug]/page.tsx Added resize message handling and position update broadcasting
client/controller/controller.go Added PTY resize functionality and size management
backend/internal/websocket/hub.go Implemented resize and position update message handling
backend/internal/types/shared.go Added resize command types and updated message structures
backend/internal/service/service.go Added resize command forwarding to agents
api/proto/shellsync.proto Added TerminalResize message type to protocol
api/proto/shellsync.pb.go Generated protobuf code for resize functionality
Readme.md Updated documentation with improved formatting and feature descriptions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread nano.18028.save
@@ -0,0 +1,2 @@
lssdks

Copilot AI Oct 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content 'lssdks' appears to be a typo or test input that should be removed.

Suggested change
lssdks

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +109
const cols = Math.max(10, Math.floor(dimensions.width / 8));
const rows = Math.max(5, Math.floor(dimensions.height / 16));

Copilot AI Oct 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers 8 and 16 are used for calculating terminal columns and rows. These should be defined as named constants to improve maintainability and make the character/line dimensions explicit.

Copilot uses AI. Check for mistakes.
Comment on lines +145 to +146
cols: Math.floor((newWidth - 20) / 9), // Approximate columns based on width
rows: Math.floor((newHeight - 100) / 17), // Approximate rows based on height

Copilot AI Oct 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different magic numbers (9, 17, 20, 100) are used here compared to the sendSizeUpdate function. This inconsistency could lead to bugs. Use the same calculation method or define these as shared constants.

Copilot uses AI. Check for mistakes.
<button
onClick={() => handleResize(-10, -10)}
className="resize-button p-1 hover:bg-gray-600 rounded text-gray-400 hover:text-white transition-colors"
title="Decrease size (-10px)"

Copilot AI Oct 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded resize increment of 10px should be defined as a constant to make it easily configurable and consistent with the handleResize function calls.

Copilot uses AI. Check for mistakes.

This branch had an error being deployed

1 failed deployment
Preview — 198e99cc Deployed Oct 14, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants